<template>
	<view v-if="pageshow">
		<u-swiper :list="webset.slides" v-if="webset.slides"  height="350"></u-swiper>
	
	    <u-notice-bar @click="jump('/pages/article/view?id='+webset.gg.id)" style="margin-top: 5px;" mode="vertical" v-if="webset.gg" :list="[webset.gg.title]" ></u-notice-bar>
	    
		
		
		<u-grid :col="4" :border="false" v-if="webset.types" >
			
				<u-grid-item @click="jump('/pages/tie/list?cid='+item.id)"  v-for="(item,index) in webset.types" :key="index">
					<image   class="ugimg" :src="item.img"></image>
					<view class="grid-text" >{{item.title}}</view>
				</u-grid-item>
			</u-grid>
			
			<view class="kg"></view>
			<view class="newcontent">
				<u-section @click="jump('/pages/tie/list')"    font-size="32" title="最新贴子" line-color="red"  ></u-section>
				<view style="height: 10px;"></view>
				<u-line color="#F1F1F1" />
			
				<block v-for="(item,index) in list" :key="index" v-if="list.length>0" >
			      <tie :item="item" ></tie>
			    </block>
				<view style="margin-top: 30rpx;" >
					<u-button @click="jump('/pages/tie/list')"  :plain="true" type="error">点击查看更多帖子</u-button>
				</view>
				
			</view>
			<foot></foot>
		
	</view>
</template>

<script>
	import {
		mapState
	} from 'vuex'
	export default {
		data() {
			return {
			pageshow:false,
		    list:[]
				
			}
		},
		onPullDownRefresh() {
			// setTimeout(function() {
			// 	uni.stopPullDownRefresh();
			// }, 1000);
			this.item_list()
		},
		onLoad:function(){
			this.item_list()
		},
		onShareAppMessage:function(){
			
		},
		computed: {
			...mapState({
				webset: state => state.set.webset //等于value(){return this.$store.state.filter.value}//filter模块中state对象中的value值
			})
		},
		methods: {
            
			item_list() {
				this.$u.post('index.php?mod=app&act=list&table=tie', {
					limit: 6,
					xcx:1,
					uid:this.user.id,
					page: 1
				}).then(res => {
					this.pageshow=true
					uni.stopPullDownRefresh();
					this.list = res.data
					console.log(this.list)
				});
			},
		}
	}
</script>

<style>
  @import url("./index.css");
</style>
